package com.principle.flyweight;

public class Client {
    public static void main(String[] args) {
        //创建一个工厂类
        WebSiteFactory webSiteFactory = new WebSiteFactory();
        WebSite webSite = webSiteFactory.getWebSiteCategory("新闻");
        webSite.use(new User("zs"));
        WebSite webSite1 = webSiteFactory.getWebSiteCategory("博客");
        webSite1.use(new User("ls"));
        WebSite webSite2 = webSiteFactory.getWebSiteCategory("微信公众号");
        webSite2.use(new User("ww"));

        WebSite webSite3 = webSiteFactory.getWebSiteCategory("博客");
        webSite3.use(new User("ll"));

        System.out.println(webSiteFactory.getWebSiteCount());
    }
}
